bool operator!() const;
true if no error flag is set (either failbit or badbit ), and false otherwise.true if either failbit or badbit is set.false otherwise. 1
2
3
4
5
6
7
8
9
10
11
// evaluating a stream (not)
#include <iostream> // std::cout
#include <fstream> // std::ifstream
int main () {
std::ifstream is;
is.open ("test.txt");
if (!is)
std::cerr << "Error opening 'test.txt'\n";
return 0;
}